'use strict'

class  shop{
  
  constructor () {

  }

  //得到动态列表
  async list (c) {
    let wuser = c.service.model.dongtai
    let ulist = await wuser.get(c.query.userid,c.query.groupid,c.query.sayid)
    c.send(ulist)
  }
 
  //发布动态
  async post(c){ 
    let data= JSON.parse(c.body)
    let result = c.service.model.dongtai
    let sayid=await result.insert(data)
    c.send(sayid)
  }

  //修改点赞
  async put (c) {
    let sayid=c.param.id
    let data=JSON.parse(c.body)
    let wuser = c.service.model.dongtai
    await wuser.update(data,sayid)
  }

}

module.exports = shop